package cn.cs.service;

import cn.cs.mapper.AgentLevelbPayMapper;
import cn.cs.mapper.AgentOrderMapper;
import cn.cs.pojo.AgentInvoice;
import cn.cs.pojo.AgentLevelbPay;
import cn.cs.pojo.AgentOrder;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@RestController
public class AgetnOrderService {

    @Resource
    private AgentOrderMapper agentOrderMapper;

    @RequestMapping(value = "/getAgentOrderById", method = RequestMethod.POST)
    public AgentOrder getAgentOrderById(@RequestParam("id") String id) throws Exception{
        return agentOrderMapper.getAgentOrderById(id);
    }

    @RequestMapping(value = "/getAgentOrderListByMap", method = RequestMethod.POST)
    public List<AgentOrder> getAgentOrderListByMap(@RequestBody Map<String, Object> param) throws Exception{
        return agentOrderMapper.getAgentOrderListByMap(param);
    }

    @RequestMapping(value = "/getAgentOrderCountByMap", method = RequestMethod.POST)
    public Integer getAgentOrderCountByMap(@RequestBody Map<String, Object> param) throws Exception{
        return agentOrderMapper.getAgentOrderCountByMap(param);
    }

    @RequestMapping(value = "/addAgentOrder", method = RequestMethod.POST)
    public Integer addAgentOrder(@RequestBody AgentOrder agentOrder) throws Exception{
        return agentOrderMapper.insertAgentOrder(agentOrder);
    }

    @RequestMapping(value = "/modifyAgentOrder", method = RequestMethod.POST)
    public Integer modifyAgentOrder(@RequestBody AgentOrder agentOrder) throws Exception{
        return agentOrderMapper.updateAgentOrder(agentOrder);
    }

    @RequestMapping(value = "/deleteAgentOrderById", method = RequestMethod.POST)
    public Integer deleteAgentOrderById(@RequestParam("id") String id) throws Exception{
        return agentOrderMapper.deleteAgentOrderById(id);
    }
}
